﻿#pragma once
#ifndef ProcessTools_hpp
#define ProcessTools_hpp


#include<string>


namespace MMF 
{

    //定义进程句柄
    #ifdef WIN32
        using ProcessHdl = unsigned long;
    #else 
        using ProcessHdl = int;
    #endif


    //系统进程相关工具
    struct ProcessTools
    {

        //运行一个exe
        static ProcessHdl RunExecutable(const std::string& path, bool showWindow = false);

        //运行一个命令行
        static ProcessHdl ExcuteCommand(const std::string& paramCmd, bool showWindow = false);

        //结束进程
        static bool KillProcess(ProcessHdl pid);

        //判断进程是否运行
        static bool CheckProcessRun(ProcessHdl pid);
    };

}



#endif